<script lang="ts" setup>
defineProps({
    title: {
        type: String,
        default: "立即抢购"
    },
    className: {
        type: String,
        default: "discount"
    },
    id: {
        type: Number,
        required: true,
    }
})
function goBuy(id: number) {
		let clickid=window.localStorage.getItem('clickId')
    const href = 'alipays://platformapi/startapp?appId=2021004105661520&page=' + encodeURIComponent(`pages/index/index?from=2023032916475592&saleuserid=2023032916475592&clickid=${clickid}`);
    // const href = 'alipays://platformapi/startapp?appId=2021004105661520&page=' + encodeURIComponent(`packageA/pages/productDetails/productDetails?__appxPageId=400&goodsId=${id}&from=2023032916475592&saleuserid=2023032916475592&clickid=${clickid}`);
    window.location.href = href;
}

</script>
<template>
    <div class="base-btn bold" :class="className" @click="goBuy(id)">
        {{ title }}
    </div>
</template>
<style lang="scss" scoped>
.base-btn {
    text-align: center;
    color: white;
    letter-spacing: 2px;
}

.discount {
    height: 44px;
    width: 160px;
    font-size: 20px;
    line-height: 44px;
    box-shadow: 0px 4px 4px 0px rgba(255, 129, 74, 0.35);
    border-radius: 58px 58px 58px 58px;
    background: linear-gradient(180deg, #FF814A 27%, #FF540A 69%, #FF0600 100%);
    margin-left: 50%;
    transform: translateX(-50%);
}

.phone {
    width: 176px;
    height: 52px;
    font-size: 28px;
    line-height: 52px;
    background: linear-gradient(90deg, #FF8A09 0%, #FC4021 100%);
    box-shadow: inset 0px -8px 8px 0px rgba(255, 244, 244, 0.24), 0px 8px 8px 0px rgba(255, 51, 2, 0.17);
    border-radius: 46px 46px 46px 46px;
}
</style>